<%--
  Created by IntelliJ IDEA.
  User: my
  Date: 2020/12/30
  Time: 11:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="/js/jquery-1.10.1.js" ></script>
    <script>
        $(function() {
            $("button").on("click", function () {

                let param = {token: window.localStorage.getItem("token"), message: $("#message").val()}
                $.get("dianming.action", param, function (data) {
                    if (data.code == 200) {
                        alert(data.message)
                        location.href="/jsp_welcome.action"
                    } else {
                        alert("练习管理员")
                    }
                }, "json").error(function(){

                    alert("练习管理员去")
                })
            })

        })

    </script>
</head>
<body>

        <textarea rows="10" cols="10" id="message"></textarea>
        <button>提交</button>

</body>
</html>
